from urllib import request,error
try:
    response = request.urlopen('###url')
except error.HTTPError as e:
    print(e.code,'\n',e.reason,'\n',e.headers)
except error.URLError as e:
    print(e.reason)
else:
    print('Request successfully')
    data = response.read()
    print(data)